import { SetupContext, toRefs } from 'vue'
import { AccordionEmit, AccordionItem, AccordionProps } from '../accordion-types'

export default function (props: AccordionProps, ctx: SetupContext<AccordionEmit>) {
  const { data, width, height } = toRefs(props)
  const clickHandle = (item: AccordionItem) => {
    ctx.emit('click', item)
  }
  return { data, width, height, clickHandle }
}
